home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / qbfaqr01.zip / QWKFMT.DOC < prev    next >
Text File  |  1992-01-19  |  24KB  |  563 lines

  1. ===========================================================================
  2.  BBS: PC Connect
  3. Date: 01-10-92 (01:57)             Number: 9134
  4. From: HOWARD MENCHER               Refer#: NONE
  5.   To: ALL                           Recvd: NO  
  6. Subj: QWK FORMAT 1-2398476           Conf: (11) R-QBasic
  7. ---------------------------------------------------------------------------
  8.                         QWK mail format information
  9.                  By Mark May - Mythical Kingdom Software
  10.         While writing a QWK utility, I found that there was no
  11.         one place where all the necessary info on the QWK format
  12.         was available.  Thru messages in several network echo
  13.         conferences (Thanks to Tim Farley, Mark Goodwin, Randy
  14.         Blackmond, Mark Herring, Patrick Lee, Greg Hewgill, and
  15.         others), I gradually collected the information enclosed
  16.         in this archive.
  17.         To save others the time collecting this information, I've
  18.         put together this set of files by editing the information
  19.         from the various sources so that it is conveniently
  20.         available.
  21.         Tim Farley is working on a more rigorous specification and
  22.         I'm sure all of us would appreciate any help you can give
  23.         him in this.   If you find any errors or additional
  24.         information, I'd also appreciate hearing about it so that
  25.         I can further update this set of files.
  26.         You may contact me at:
  27.  
  28.         Fido - 1:110/290
  29.         RIME - ->MYTHKING
  30.         Normal Bbs 513-237-7737 (at 9600 HST/V32)
  31.  
  32.         You may also contact me in the P/Net (programmers network)
  33.         Bbs/Utils developers conference.
  34.  
  35.         Changes:
  36.         v1.1 08/17/91 Added information on Door.Id
  37.                       Added info on conferences above 255
  38.                       Added info on message has tagline field
  39.                       Corrected info on message status values
  40.         v1.0 05/28/91 Initial release
  41. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  42.                      Old style configuration commands
  43.  
  44.       To: QMAIL (or whatever)
  45.  
  46.       Subject contains one of the following commands:
  47.  
  48.       ADD                   Add current conference
  49.       ADD -20               Add current conference and set lastread pointer
  50.                             20 below the end
  51.       ADD 9876              Add current conference and set lastread pointer
  52.                             to message number 9876
  53.       DROP                  Drop current conference
  54.       RESET                 Reset current conference lastread pointer to
  55.                             the end
  56.       RESET -20             Reset current conference lastread pointer to
  57.                             20 below the end
  58.       RESET 9876            Reset current conference lastread pointer to
  59.                             message number 9876
  60.       BLTS ON               Turn bulletins on
  61.       BLTS OFF              Turn bulletins off
  62.       FILES ON              Turn new files list on
  63.       FILES OFF             Turn new files list off
  64.       WELCOME ON            Turn welcome screen on
  65.       WELCOME OFF           Turn welcome screen off
  66.       GOODBYE ON            Turn goodbye screen on
  67.       GOODBYE OFF           Turn goodbye screen off
  68.       If the subject is CONFIG, see the new format in COMMAND.TXT
  69.       for an explanation.
  70. ------------------------------------------------------------------------------
  71.                  New (04/91) format for configuration messages
  72.  
  73.         To: QMAIL (or whatever)
  74.         Subject: CONFIG
  75.         Text has one command per line with the following options:
  76.         ADD <conf>                  adds a conference
  77.         DROP <conf>                 drops a conference
  78.         RESET <conf> <value>        resets message pointer to value or
  79.                                     can use HIGH-xxx
  80.         CITY <string>               changes bbs user city
  81.         PASSWORD <string>           changes bbs user password
  82.         BPHONE <string>             changes bbs user business/data phone
  83.         HPHONE <string>             changes bbs user home/voice phone
  84.         PCBEXPERT [ON|OFF]          turns bbs user expert mode on or off
  85.         PCBPROT <char>              sets bbs user protocol to char (A thru Z)
  86.         PCBCOMMENT <string>         sets bbs user comment
  87.         PAGELEN <value>             sets bbs use pagelength
  88.         PROTOCOL <char>             sets QWK door protocol to char (A thru Z)
  89.         EXPERT [ON|OFF]             sets QWK door expert mode on or off
  90.         MAXSIZE <value>             sets maximum QWK size in bytes
  91.         MAXNUMBER <value>           sets maximum msgs per conference
  92.         AUTOSTART                   QWK door autostart
  93. ------------------------------------------------------------------------------
  94. <<<<< CONTINUED NEXT MESSAGE >>>>>>
  95.  
  96. ---
  97.  ■ SLMR 2.1a ■ !enif tsuj si gnihtyrevE
  98.  
  99.  
  100. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  101.  
  102. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  103. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  104. ===========================================================================
  105.  BBS: PC Connect
  106. Date: 01-10-92 (01:58)             Number: 9135
  107. From: HOWARD MENCHER               Refer#: NONE
  108.   To: ALL                           Recvd: NO  
  109. Subj: QWK FORMAT 2 -1289376          Conf: (11) R-QBasic
  110. ---------------------------------------------------------------------------
  111. <<<<< CONTINUED FROM MESSAGE 1 >>>>>
  112.                         Format of Control.Dat file
  113.  
  114.       Control.Dat is a normal CR/LF style text file with the
  115.       following lines in exactly the order shown.
  116.  
  117. BBS name
  118. BBS City, BBS State
  119. BBS phone number                     {AAA-EEE-NNNN}
  120. Sysop name,Sysop                     {Sysop name in upper case followed
  121.                                       by the literal ',Sysop'}
  122. Serial number ,BBS ID                {Serial Number, UpperCase BBSID}
  123. Date of mail packet, time of packet  {MM-DD-YYYY,HH:MM:SS}
  124. Caller's name                        {Uppercase}
  125. blank
  126. 0
  127. 0
  128. Number of conferences (in additon to conference 0 which is main)
  129.                       (ie use number of conferences minus one)
  130. Conference number
  131. Name of Conference    (should be limited to maximum length of 12 characters)
  132. ...
  133. Conference number
  134. Name of Conference
  135. name of BBS welcome file
  136. name of NEWS file
  137. name of BBS goodbye file
  138.  
  139. Other optional data may occur after the Goodbye file line, but the
  140. trend is to omit this data.  If included it is as follows:
  141.  
  142. 0                                    {Unknown}
  143. Screen Length
  144. USER NAME                            {Upper case}
  145. FirstName                            {Proper case}
  146. CITY, ST                             {Upper case}
  147. Data Phone                           {AAA EEE-NNNN}
  148. Voice Phone                          {AAA EEE-NNNN}
  149. Security Level
  150. Expiration Date                      {MM-DD-YY}
  151. Last On Date                         {MM-DD-YY}
  152. Last On Time                         {HH:MM}
  153. Number of calls
  154. 0                                    {Unknown}
  155. DownLoaded Bytes
  156. DownLoaded Count
  157. Uploaded Bytes
  158. Uploaded Count
  159. Time Limit Per Day                   {Minutes}
  160. Time Remaining                       {Minutes}
  161. Time Used Today                      {Minutes}
  162. DownLoad Limit/Day                   {Kilobytes}
  163. DownLoad Bytes Remaining Today       {Bytes}
  164. DownLoaded Today                     {Bytes}
  165. Current Time                         {HH:MM}
  166. Current Date                         {MM-DD-YY}
  167. System Tag Line
  168. --------------------------------------------------------------------------
  169.           DOOR.ID
  170.  
  171.           Many maildoors now produce (and readers use) a file called
  172.           Door.Id that was developed by Greg Hewgill.  It is intended
  173.           to give the reader information on the capabilities of the
  174.           door that produced the packet (and presumably will process
  175.           the *.REP produced).  It is a straight text file with the
  176.           following format.  Each line is in the format ControlWord
  177.           space equals space value.
  178.  
  179.           DOOR = <doorname>
  180.                This is the name of the door that created the QWK
  181.                packet, eg.  <doorname> = Tomcat.
  182.  
  183.           VERSION = <doorversion>
  184.                This is the version number of the door that created
  185.                the packet,  eg. <doorversion> = 2.9.
  186.  
  187.           SYSTEM = <systemtype>
  188.                This is the underlying BBS system type and version,
  189.                eg. <systemtype> = Wildcat 2.55.
  190.  
  191.           CONTROLNAME = <controlname>
  192.                This is the name to which the reader should send
  193.                control messages, eg. <controlname> = TOMCAT.
  194.  
  195.           CONTROLTYPE = <controltype>
  196.                This can be one of ADD, DROP, or REQUEST (or others).
  197.                ADD and DROP are pretty obvious (they work as in
  198.                Markmail), and REQUEST is for use with BBS systems
  199.                that support file attachments.  Try out SLMR with
  200.                CONTROLTYPE = REQUEST and use the Q function.
  201. <<<<< CONTINUED NEXT MESSAGE >>>>>
  202. ---
  203.  ■ SLMR 2.1a ■ The best way to accelerate a Mac is at 9.8 m/s²
  204.  
  205. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  206.  
  207. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  208. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  209. ===========================================================================
  210.  BBS: PC Connect
  211. Date: 01-10-92 (01:58)             Number: 9136
  212. From: HOWARD MENCHER               Refer#: NONE
  213.   To: ALL                           Recvd: NO  
  214. Subj: QWK FORMAT 3 - 2345786         Conf: (11) R-QBasic
  215. ---------------------------------------------------------------------------
  216.          <<<<< CONTINUED FROM MESSAGE 2 >>>>>
  217.  
  218.          RECEIPT
  219.                This flag indicates that the door/BBS is capable of
  220.                return receipts when a message is received.  If the
  221.                first three letters of the subject are RRR, then the
  222.                door should strip the RRR and set the 'return-receipt-
  223.                requested' flag on the corresponding message.
  224. ----------------------------------------------------------------------------
  225.  
  226.                    Filenames used by the *.QWK format
  227.  
  228.         BBSID.QWK is an archive containing the files from the
  229.         message door being sent to the caller.
  230.  
  231.             MESSAGES.DAT - a file containing the messages themselves
  232.                in 128 byte records.
  233.  
  234.             CONTROL.DAT - a file with info on the system, caller, and
  235.                conference names and numbers.
  236.  
  237.             999.NDX - one file for each selected conference that
  238.                contains pointers to the messages in MESSAGES.DAT
  239.                There are usually several *.NDX files in each
  240.                QWK file.  (Right justified, padded with leading
  241.                zeros to make the 3 characters).
  242.  
  243.             NEWFILES.DAT - an optional file that contains a list
  244.                of new files from the Bbs.
  245.  
  246.             BLT-0.99 - optional files containing ascii or ansi
  247.                bulletins.  The 99 extension is replaced by the
  248.                bulletin number (Left justified not padded).
  249.  
  250.             DOOR.ID - an optional text file that contains info
  251.                on the capabilities of the door that produced the
  252.                QWK packet (so that the reader will only send
  253.                control messages that can be handled).
  254.  
  255.             SESSION.TXT - an optional ascii/ansi file containing
  256.                info on the activity occuring in the mail door.
  257.  
  258.             Optionally it may also contain ascii or ansi screens for
  259.             Welcome, News, and Goodbye as named in the CONTROL.DAT
  260.             file.
  261.  
  262.         BBSID.REP is an archive containing a single file of the
  263.         messages sent from the caller to the Bbs.
  264.  
  265.             BBSID.MSG - a file containing the messages themselves
  266.                in 128 byte records.  The format is similar to
  267.                MESSAGES.DAT.
  268. ---------------------------------------------------------------------------
  269.  
  270.               Format of the exported messages in Messages.Dat
  271.  
  272.  
  273.          This file contains records with a length of 128 bytes.  There
  274.          are 3 types of these records: (1) Packet Header, (2) Message
  275.          Header, and (3) Message Text.  All unused fields in the
  276.          records are normally filled with spaces, although you will
  277.          sometimes find the final Message text record will be filled
  278.          with nulls (#0) after the last text.
  279.  
  280.  
  281.                               Packet Header
  282.  
  283.          Packet Header - is always the first record in the file and
  284.          only occurs once.  It contains only normal ascii text
  285.          (limitted to at most 128 characters) and should always
  286.          start with "Produced by ".  The remaining text normally
  287.          includes a product name and copyright message.
  288.  
  289.  
  290.                               Message Header
  291.  
  292. <<<<< CONTINUED NEXT MESSAGE >>>>>
  293. ---
  294.  ■ SLMR 2.1a ■ Death:  to stop sinning suddenly.
  295.  
  296. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  297.  
  298. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  299. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  300. ===========================================================================
  301.  BBS: PC Connect
  302. Date: 01-10-92 (01:58)             Number: 9137
  303. From: HOWARD MENCHER               Refer#: NONE
  304.   To: ALL                           Recvd: NO  
  305. Subj: QWK FORMAT 4- ALKDFJ           Conf: (11) R-QBasic
  306. ---------------------------------------------------------------------------
  307.   <<<<< CONTINUED FROM MESSAGE 3 >>>>>
  308.  
  309.          A message header immediately preceeds zero or more message
  310.          text records.  Each Message header has the following
  311.          format:
  312.  
  313.          Start
  314.           Pos  Length              Description
  315.         ------ ------ -----------------------------------------
  316.            1      1   Message status flag (see below)
  317.            2      7   Message number (ascii left justified)
  318.            9      8   Date (MM-DD-YY)
  319.           17      5   Time (HH:MM)
  320.           22     25   To (left justified space filled - uppercase)
  321.                       (Be sure to check the to field to spot
  322.                       configuration type messages)
  323.           47     25   From (left justified space filled - uppercase)
  324.           72     25   Subject (left justified space filled - uppercase)
  325.                       (a subject starting "NE:" should not be
  326.                       echoed into a network)
  327.           97     12   Password (not really used leave blank)
  328.          109      8   Message reference number (ascii left justified)
  329.          117      6   Number of blocks (ascii left justified - number
  330.                       of 128 byte blocks including 1 for the message
  331.                       header)
  332.          123      1   Message active
  333. (ß or #225 = Active,
  334.                       Γ or #226 = Inactive)
  335.          124      2   Conference number (Binary Word) (Lo in 124, Hi
  336.                       in 125).  Note that some older programs only
  337.                       supported conferences 0 thru 255 and left byte
  338.                       125 as a "blank" unused field.  I recommend
  339.                       checking the word value and if it is over 8191
  340.                       to only use the lower (0 thru 255) part of it.
  341.                       I've also seen notes that this field is really
  342.                       a 4 byte LongInt field, although with the above
  343.                       limitation (and 8000 conference seeming sufficient
  344.                       for a while), I documented it this way.
  345.  
  346.          128      1   Indicates whether the message has a Network
  347.                       tagline or not.  A value of "*" indicates that
  348.                       a network tagline is present, a value of " "
  349.                       indicates there isn't.  Messages sent to readers
  350.                       (non-net-status) generally leave this as always
  351.                       blank since only net utils need this info.
  352.  
  353.          Message Status Flag has the following possibilities:
  354.  
  355.          '`'  Comment to sysop, read      '~'  Comment to sysop, unread
  356.          '-'  Public, read                ' '  Public, unread
  357.          '*'  Private, read               '+'  Private, unread
  358.          '^'  Password protected, read    '%'  Password protected, unread
  359.          '#'  Group password, read        '!'  Group password, unread
  360.          '$'  Group password to all
  361.  
  362.                              Message Text Records
  363.  
  364.          The message text records immediately follow the the message
  365.          header.  They contain straight ascii text (lines are
  366.          normally limitted to 72 chars/line although you may see
  367.          longer lines).  Each line is followed by a "
  368. " or #227
  369.          character to mark the end of the line (in place of the normal
  370.          CR/LF that would exist in a straight text file).  The text
  371.          continues consecutavly and text lines do continue across
  372.          block boundaries.  Some systems or readers may have problems
  373.          with messages longer than 99 lines or 199 lines, although more
  374.          recently this no longer seems to be a limit.  The last block
  375.          should be padded with blanks to fill the block, although on
  376.          input you may find it padded with nulls (#0).
  377. -----------------------------------------------------------------------------
  378.                            Format of Index files
  379.       Index files are named XXX.NDX (where XXX is the conference
  380.       number padded with leading zeros to make it three characters
  381.       long.  There is one *.NDX file for each conference chosen that
  382.       contains messages in the MESSAGES.DAT file.
  383.       The *.NDX file contain records five characters long that point
  384.       to each message in that conference.
  385.  
  386.       NdxRecord = Record
  387.         MsgPointer: BasicReal
  388.         Conference: Byte;
  389.         End;
  390.       The BasicReal is a four byte number in BASIC MKS$ format.
  391.  
  392.       The following is a sample program unit for TurboPascal that
  393.       converts between BasicReal format and LongInt format.
  394.  
  395. <<<<< CONTINUED NEXT MESSAGE >>>>>
  396. ---
  397.  ■ SLMR 2.1a ■ Prepositions are not a good thing to end a sentence with.
  398.  
  399. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  400.  
  401. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  402. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  403. ===========================================================================
  404.  BBS: PC Connect
  405. Date: 01-10-92 (01:58)             Number: 9138
  406. From: HOWARD MENCHER               Refer#: NONE
  407.   To: ALL                           Recvd: NO  
  408. Subj: QWK FORMAT 5 -WEQUIY           Conf: (11) R-QBasic
  409. ---------------------------------------------------------------------------
  410. <<<<< CONTINUED FROM MESSAGE 4 >>>>>
  411.  
  412. Unit BasicConvert;
  413.  
  414. Interface
  415.   Function BasicReal2Long(InValue: LongInt): LongInt;
  416.                 {Convert Basic Short Reals to LongInts}
  417.  
  418.   Function Long2BasicReal(InValue: LongInt): LongInt;
  419.                 {Convert LongInts to Basic Short Reals}
  420.  
  421. Implementation
  422.  
  423. Function BasicReal2Long(InValue: LongInt): LongInt;
  424.  
  425.   Var
  426.   Temp: LongInt;
  427.   Negative: Boolean;
  428.   Expon: Integer;
  429.  
  430.   Begin
  431.     If InValue And $00800000 <> 0 Then
  432.       Negative := True
  433.     Else
  434.       Negative := False;
  435.     Expon := InValue shr 24;
  436.     Expon := Expon and $ff;
  437.     Temp := InValue and $007FFFFF;
  438.     Temp := Temp or $00800000;
  439.     Expon := Expon - 152;
  440.     If Expon < 0 Then Temp := Temp shr Abs(Expon)
  441.       Else Temp := Temp shl Expon;
  442.     If Negative Then
  443.       BasicReal2Long := -Temp
  444.     Else
  445.       BasicReal2Long := Temp;
  446.     If Expon = 0 Then
  447.       BasicReal2Long := 0;
  448.   End;
  449.  
  450.  
  451. Function Long2BasicReal(InValue: LongInt): LongInt;
  452.   Var
  453.   Negative: Boolean;
  454.   Expon: LongInt;
  455.  
  456.   Begin
  457.   If InValue = 0 Then
  458.     Long2BasicReal := 0
  459.   Else
  460.     Begin
  461.     If InValue < 0 Then
  462.       Begin
  463.       Negative := True;
  464.       InValue := Abs(InValue);
  465.       End
  466.     Else
  467.       Negative := False;
  468.     Expon := 152;
  469.     If InValue < $007FFFFF Then
  470.       While ((InValue and $00800000) = 0) Do
  471.         Begin
  472.         InValue := InValue shl 1;
  473.         Dec(Expon);
  474.         End
  475.     Else
  476.       While ((InValue And $FF000000) <> 0) Do
  477.         Begin
  478.         InValue := InValue shr 1;
  479.         Inc(Expon);
  480.         End;
  481.     InValue := InValue And $007FFFFF;
  482.     If Negative Then
  483.       InValue := InValue Or $00800000;
  484.     Long2BasicReal := InValue + (Expon shl 24);
  485.     End;
  486.   End;
  487.  
  488. End.
  489.  
  490.  
  491. <<<<< CONTINUED NEXT MESSAGE >>>>>
  492. -
  493. ---
  494.  ■ SLMR 2.1a ■ 76% of those polled felt polls asked trivial questions.
  495.  
  496.  
  497. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  498.  
  499. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  500. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  501. ===========================================================================
  502.  BBS: PC Connect
  503. Date: 01-10-92 (01:58)             Number: 9139
  504. From: HOWARD MENCHER               Refer#: NONE
  505.   To: ALL                           Recvd: NO  
  506. Subj: QWK FORMAT 6 -WIERYU           Conf: (11) R-QBasic
  507. ---------------------------------------------------------------------------
  508. <<<<< CONTINUED FROM MESSAGE 5 >>>>>
  509.  
  510. -----------------------------------------------------------------------------
  511.  
  512. A quick and dirty conversion (handles positive numbers only) is possible
  513. with the following expression:
  514.  
  515. MKSToNum := ((x AND NOT $ff000000) OR $00800000)
  516.              SHR (24 - ((x SHR 24) AND $7f));
  517.  
  518. ------------------------------------------------------------------------------
  519.  
  520.       The number contained in the MsgPointer is the record number
  521.       (128 byte records - starting numbering from record 1 not 0)
  522.       of the message header.  Note that since the 1st record contains
  523.       packet header, the lowest MsgPointer that can exist is 2.
  524.  
  525.       Some message readers will reformat the *.NDX files so that the
  526.       MsgPointer becomes a LongInt fileseek position (using a record
  527.       size of 1).  To determine which type of index you are reading
  528.       you should look at the size of the number.  Any BasicReal will
  529.       appear as a huge number that would unlikely ever be a byte
  530.       seek positon.
  531.  
  532.  
  533. -----------------------------------------------------------------------------
  534.  
  535.  
  536.                  Format of the BBSID.REP file for replies
  537.  
  538.  
  539.       The record format of the BBSID.MSG file in the BBSID.REP file
  540.       is exactly identical to the MESSAGES.DAT format except the
  541.       packet header which now is filled with blanks except that it
  542.       contains the BBSID as the first few characters.
  543.  
  544.  
  545.       On the Message Headers there is also one change.  The ascii
  546.       field which normally contains the message number is now filled
  547.       (in ascii) with the conference number of the message.  Note
  548.       that some readers which place the conference number here,
  549.       neglect to fill in the normal Message Header conference
  550.       number field.
  551.  
  552.  
  553. <<< END OF DOCUMENT >>>
  554.  
  555. <<<<< END THIS GROUP   6 OF 6 >>>>>
  556. ---
  557.  ■ SLMR 2.1a ■ Have you hugged an electric fence today?
  558.  
  559. RBBS-UTI v2.0 : by Bob Snyder - (703)323-6423/1782 HST
  560.  
  561. PCRelay:GREYHAWK -> #837 RelayNet (tm)
  562. 4.10                DGS -Viper- (410)465-3891 / 461-9943 USR/DS's
  563.